home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: How can you make this work?
- Date: Mon, 15 Apr 96 18:28:23 GMT
- Organization: none
- Message-ID: <829592903snz@genesis.demon.co.uk>
- References: <4kr886$13t@hermes.oanet.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4kr886$13t@hermes.oanet.com> scorpion@portal.connect.ab.ca writes:
-
- > I need to know why this gives an 'Illegal Pointer
- >Arithmetic' error ; It's supposed to be a pixel write routine:
- >
- >void putpixel(short x,short y,unsigned char colour)
- >{ char far *Startofvidmem;
- > char far *Location; /* Address of where to write the
-
- far isn't part of the C language but rather an extension provided by your
- particular compiler. Assuming you get the same error without it then...
-
- >pixel*/
- > Startofvidmem = 0xA000;
-
- ...here you are trying to assign an integer to a pointer which is illegal.
- You could try casting to the appropriate type for assignment or maybe your
- implementation provides a macro in a header file that builds pointers to
- specific addresses for you (maybe something like MK_FP() ). However this is
- outside the realms of the C language - try comp.os.msdos.programmer for
- further discussion.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-